<?php
/** @var EntidadController $this */
/** @var Entidad $model */
/** @var AweActiveForm $form */
?>
<div class="col-lg-12">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title"><?php echo Yii::t('AweCrud.app', $model->isNewRecord ? 'Create' : 'Update') . ' ' . Entidad::label(1); ?></h3>
        </div>
        <div class="panel-body">

            <?php
            $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
                'type' => 'horizontal',
                'id' => 'entidad-form',
                'enableAjaxValidation' => true,
                'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
                'enableClientValidation' => false,
            ));
            ?>
            <?php echo $form->textFieldGroup($model, 'razon_social', array('maxlength' => 64)) ?>
            <?php echo $form->textFieldGroup($model, 'nombre', array('maxlength' => 64)) ?>
            <?php echo $form->textAreaGroup($model, 'atencion', array('maxlength' => 45)) ?>
            <?php echo $form->textAreaGroup($model, 'descripcion', array('rows' => 3, 'cols' => 50)) ?>
            <?php echo $form->textFieldGroup($model, 'website', array('maxlength' => 45)) ?>
            <?php echo $form->textFieldGroup($model, 'razon_social', array('maxlength' => 64)) ?>

            <div class="row-fluid" >

                <div class="col-lg-6">
                    <?php echo $form->textFieldGroup($model, 'documento', array('maxlength' => 20)) ?>
                    <?php echo $form->textFieldGroup($model, 'email', array('maxlength' => 45)) ?>

                </div>    
                <div class="col-lg-6">
                    <?php echo $form->textFieldGroup($model, 'telefono', array('maxlength' => 45)) ?>
                    <?php echo $form->textFieldGroup($model, 'celular', array('maxlength' => 45)) ?>
                </div>    

            </div>
            <div class="row-fluid" >

                <div class="col-lg-6">
                    <?php echo $form->dropDownListGroup($model, 'industria_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-12',), 'widgetOptions' => array('data' => array('' => ' -- Seleccione -- ') + CHtml::listData(Industria::model()->findAll(), 'id', Industria::representingColumn()), 'htmlOptions' => array('empty' => Yii::t('AweApp', 'None')),))) ?>

                </div>    
                <div class="col-lg-6">
                    <?php echo $form->dropDownListGroup($model, 'categoria_id', array('wrapperHtmlOptions' => array('class' => 'col-sm-12',), 'widgetOptions' => array('data' => array('' => ' -- Seleccione -- ') + CHtml::listData(Categoria::model()->findAll(), 'id', Categoria::representingColumn()), 'htmlOptions' => array('empty' => Yii::t('AweApp', 'None')),))) ?>
                </div>    

            </div>
            <?php echo $form->hiddenField($model, 'id') ?>
        </div>
    </div>
</div>

<div class="form-group">
    <div class="col-lg-10 col-lg-offset-2">
        <?php
        $this->widget('booster.widgets.TbButton', array(
            'buttonType' => 'success',
            'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
            'htmlOptions' => array(
                'onclick' => 'js:ajaxSave("#entidad-form")'
            )
        ));
        ?>
        <?php
        $this->widget('booster.widgets.TbButton', array(
            'label' => Yii::t('AweCrud.app', 'Cancel'),
            'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
        ));
        ?>
        <?php $this->endWidget(); ?>
    </div>
</div>